home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / progut~1 / iostream.zoo / test / tgetl.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-22  |  318 b   |  18 lines

  1. #include <iostream.h>
  2.  
  3. main(int argc, char** argv)
  4. {
  5.     istream *istr = &cin;
  6.     char buf[40];
  7.     int i = 0;
  8.     for (;;) {
  9.     i ++;
  10.     istr->getline(buf, 40);
  11.     if (istr->gcount() == 0)
  12.         break;
  13.     cout << "Line " << i << " (" << istr->gcount()
  14.         << "char): [" << buf << "]\n";
  15.         cerr << buf << "\n";
  16.     }
  17. }
  18.